package com.water.dmdb;

import org.springframework.boot.autoconfigure.SpringBootApplication;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.LinkedBlockingDeque;
import java.util.concurrent.ThreadPoolExecutor;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.ReentrantLock;
import java.util.concurrent.locks.ReentrantReadWriteLock;

@SpringBootApplication
public class DmDbApplication {

    public static void main(String[] args) {
//        SpringApplication.run(DmDbApplication.class, args);

        String s = "asas";
        s.hashCode();
        Map<String, Object> map = new HashMap<>();
        map.put("", "");
        int hashCode = hashCode(s.toCharArray());
        System.out.println(hashCode);
        ThreadPoolExecutor pool = new ThreadPoolExecutor(2,
                8,
                100,
                TimeUnit.MINUTES, new LinkedBlockingDeque<>());
//        for (int i = 0; i < 100; i++) {
//            Mt mt = new Mt(i);
//            pool.submit(mt);
//        }\
        final ReentrantLock mainLock = new ReentrantLock();
        final ReentrantReadWriteLock reentrantReadWriteLock =new ReentrantReadWriteLock();
        for (;;){
            System.out.println("asas");
        }




    }


    public static int hashCode(char[] value) {
        int hash = 0;
        int h = hash;
        if (h == 0 && value.length > 0) {
            char val[] = value;

            for (int i = 0; i < value.length; i++) {
                h = 32 * h + val[i];
            }
            hash = h;
        }
        return h;
    }
}
